package com.example.arouter;

import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.annotation.Interceptor;
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
import com.alibaba.android.arouter.facade.template.IInterceptor;

@Interceptor(priority = 7)
public class TestInterceptor implements IInterceptor {

    private Context mContext;

    @Override
    public void process(Postcard postcard, InterceptorCallback callback) {
        if(postcard.getPath().equals("/test/activity")){
//            callback.onInterrupt(new Exception("我不想跳转"));
        }
        Log.e("androidLog","process ="+postcard.getPath());
    }

    @Override
    public void init(Context context) {
        this.mContext = context;
    }
}
